S:=$(wildcard *.s)

ALL:= led.bin

ELF:= led.elf

OBJS := $(S:%.s=%.o)

$(ALL):$(ELF)
	arm-linux-gnueabihf-objcopy -O binary -S -g $? $@
	arm-linux-gnueabihf-objdump -D $? > led.dis
	./imxdownload ./$@ ./imx 
$(ELF):$(OBJS)
	arm-linux-gnueabihf-ld -Ttext 0X87800000 $^ -o $@

%.o:%.s
	arm-linux-gnueabihf-gcc -g -c $? -o $@

clear:
	rm -rf *.o led.bin led.elf led.dis load.imx imx
